<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%
	request.setCharacterEncoding("gbk");
	
	String action = request.getParameter("action");
	
	if(action != null && action.equals("action")) {
		String name = request.getParameter("user");
		String password = request.getParameter("password");
		if(name == null || !name.equals("admin")) {
			out.println("用户名不正确，请重新输入");
			return;
		}else if(password == null || !password.equals("admin")){
			out.println("密码不正确，请重新输入");
			//return;
		}else{
			session.setAttribute("admin","true");
			response.sendRedirect("ShowArticleTree.jsp");
		}
			
			
			
	}
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

</head>
<body>

<form action="Admin.jsp" method="post">
 <input type="hidden" name="action" value="action">
  
  <table border="0">
   
    <tr>
      <td>请输入用户名<input type="password" name="user"></td>
    </tr>
    
     <tr>
      <td>请输入密码&nbsp;<input type="password" name="password"></td>
    </tr>
     <tr>
      <td><input type="submit" value="提交" ></td>
    </tr>
  </table>
</form>



</body>
</html>